home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / OSSCHEME.C < prev    next >
C/C++ Source or Header  |  1992-02-03  |  3KB  |  135 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/src/microcode/RCS/osscheme.c,v 1.6 1992/02/04 04:14:32 jinx Exp $
  4.  
  5. Copyright (c) 1990-92 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. #include "scheme.h"
  36. #include "osscheme.h"
  37.  
  38. extern void
  39.   EXFUN (signal_error_from_primitive, (long error_code));
  40.  
  41. void
  42. DEFUN_VOID (error_out_of_channels)
  43. {
  44.   signal_error_from_primitive (ERR_OUT_OF_FILE_HANDLES);
  45. }
  46.  
  47. void
  48. DEFUN_VOID (error_out_of_processes)
  49. {
  50.   signal_error_from_primitive (ERR_OUT_OF_FILE_HANDLES);
  51. }
  52.  
  53. void
  54. DEFUN_VOID (error_unimplemented_primitive)
  55. {
  56.   signal_error_from_primitive (ERR_UNDEFINED_PRIMITIVE);
  57. }
  58.  
  59. void
  60. DEFUN_VOID (error_floating_point_exception)
  61. {
  62.   signal_error_from_primitive (ERR_FLOATING_OVERFLOW);
  63. }
  64.  
  65. int
  66. DEFUN_VOID (executing_scheme_primitive_p)
  67. {
  68.   return (PRIMITIVE_P (Regs [REGBLOCK_PRIMITIVE]));
  69. }
  70.  
  71. void
  72. DEFUN_VOID (request_character_interrupt)
  73. {
  74.   REQUEST_INTERRUPT (INT_Character);
  75. }
  76.  
  77. void
  78. DEFUN_VOID (request_timer_interrupt)
  79. {
  80.   REQUEST_INTERRUPT (INT_Timer);
  81. }
  82.  
  83. void
  84. DEFUN_VOID (request_suspend_interrupt)
  85. {
  86.   REQUEST_INTERRUPT (INT_Suspend);
  87.   return;
  88. }
  89.  
  90. int
  91. DEFUN_VOID (pending_interrupts_p)
  92. {
  93.   return (INTERRUPT_PENDING_P (INT_Mask));
  94. }
  95.  
  96. void
  97. DEFUN_VOID (deliver_pending_interrupts)
  98. {
  99.   if (INTERRUPT_PENDING_P (INT_Mask))
  100.     signal_interrupt_from_primitive ();
  101.   return;
  102. }
  103.  
  104. long
  105. DEFUN_VOID (get_interrupt_mask)
  106. {
  107.   return (FETCH_INTERRUPT_MASK ());
  108. }
  109.  
  110. void
  111. DEFUN (set_interrupt_mask, (mask), long mask)
  112. {
  113.   SET_INTERRUPT_MASK (mask & INT_Mask);
  114.   return;
  115. }
  116.  
  117. void
  118. DEFUN (debug_back_trace, (stream), FILE * stream)
  119. {
  120.   fputs ("*** Scheme Microcode Back Trace: ***\n", stream);
  121.   Back_Trace (stream);
  122.   fputs ("*** End of Back Trace ***\n", stream);
  123.   fflush (stream);
  124.   return;
  125. }
  126.  
  127. void
  128. DEFUN (debug_examine_memory, (address, label),
  129.        long address AND
  130.        CONST char * label)
  131. {
  132.   Print_Expression ((* ((SCHEME_OBJECT *) address)), ((char *) label));
  133.   return;
  134. }
  135.